package org.techmore.hakka;

import java.util.ArrayList;
import java.util.List;

import org.techmore.bussiness.VisitorSoundActivityDataHandler;
import org.techmore.common.utils.activity.ActivityUtils;
import org.techmore.common.utils.sound.SoundPoolUtils;
import org.techmore.valueobject.VisitorListViewVO;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;

public class VisitorSoundActivity extends Activity {
	
	private Button locationShowBack = null;
	private Button mainActivityBack = null;
	
	private ListView visitorListView = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		ActivityUtils.getInstance().setScreenOrientation(this);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.vistor_sound);
		
		locationShowBack = (Button) findViewById(R.id.locationShowBack);
		locationShowBack.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				SoundPoolUtils.getInstance(VisitorSoundActivity.this).playSound(SoundPoolUtils.SOUND_BUTTON_CLICK);
				VisitorSoundActivity.this.finish();
			}
		});
		mainActivityBack = (Button) findViewById(R.id.mainActivityBack);
		mainActivityBack.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				SoundPoolUtils.getInstance(VisitorSoundActivity.this).playSound(SoundPoolUtils.SOUND_BUTTON_CLICK);
				ActivityUtils.getInstance().leftIN_rightOUT_close_Transition(VisitorSoundActivity.this, VisitorSoundActivity.this, MainActivity.class);
			}
		});
		
		
		visitorListView = (ListView) findViewById(R.id.visitorListView);
		
		List<VisitorListViewVO> list = new ArrayList<VisitorListViewVO>();
		list.add(new VisitorListViewVO("11111111","四席强","【(ge coi)】"));
		list.add(new VisitorListViewVO("22222222","四席强","【(ge coi)】"));
		list.add(new VisitorListViewVO("33333333","四席强","【(ge coi)】"));
		list.add(new VisitorListViewVO("44444444","四席强","【(ge coi)】"));
		
		visitorListView.setAdapter(VisitorSoundActivityDataHandler.getInstance().new VisitorSoundListViewAdapter(this, list));
		
	}
	
}
